package adv331;


import java.io.FileOutputStream;
import java.io.IOException;
import java.io.ObjectOutputStream;
import java.util.ArrayList;
import java.util.List;

/**
 * @author oldliu
 * @since 1.0
 */
public class StuentBaocun {
    public static void main(String[] args) {
        List<Student> list=new ArrayList<>();
        list.add(new Student("赵俊杰",21,Sex.男,"11111"));
        list.add(new Student("林俊杰",21,Sex.妖,"2222"));
        list.add(new Student("王莽",66,Sex.妖,"4444"));
        list.add(new Student("李斯",21,Sex.妖,"5555555"));

        try {
            ObjectOutputStream oout=new ObjectOutputStream(new FileOutputStream("d:/temp/student.txt"));
            oout.writeObject(list);
            oout.close();
        } catch (IOException e) {
            e.printStackTrace();
        }

    }
}
